#include <iostream>
#include <memory>
#include "UdpServer.hpp"

string fun_c(const string&kk)
{
    string a = "hello,";
    a += kk;
    return a;
}

// 输入  ./UdpServer  port
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        cerr << "Usages:" << argv[0] << " port" << endl;
        return 1;
    }
    uint16_t _port = stoi(argv[1]);
    Enable_Console_Log_Strategy();
    unique_ptr<UdpServer> Udp = make_unique<UdpServer>(_port, fun_c);
    Udp->Init();
    Udp->Start();
    return 0;
}